package com.effectivcrm.controller;

import lombok.extern.slf4j.Slf4j;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import com.effectivcrm.domain.Address;
import com.effectivcrm.domain.Lead;

@Controller
@Slf4j
public class CreateLeadController {

	@ModelAttribute
	public Lead initLead(){
		Lead lead =  new Lead();
		lead.setAddress(new Address());
		
		log.info("Lead = {}", lead);
		log.info("Address = {}", lead.getAddress());
		
		return new Lead();
	}
	
		
	@RequestMapping(value="/createlead")
	public String createLead(){
		return "createlead";
	}
	
}
